﻿using System;
using System.Windows.Data;
using System.Windows.Media;

namespace CodeHighlighter.Model
{
    public class CodeWordTypeToBrushConverter : IValueConverter
    {

        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            var type = (CodeWordType)value;
            switch (type)
            {
                case CodeWordType.Keyword:
                    return new SolidColorBrush(Colors.Blue);
                case CodeWordType.Comment:
                    return new SolidColorBrush(Colors.Green);
                case CodeWordType.Bracket:
                    return new SolidColorBrush(Colors.Cyan);
                case CodeWordType.Math:
                    return new SolidColorBrush(Colors.Purple);
            }
            return new SolidColorBrush(Colors.Black);
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
